#ifndef PLAYSTATE_H
#define PLAYSTATE_H


#include <graphics/sprite_renderer.h>
#include <graphics/font.h>
#include <iostream>
#include <input/sony_controller_input_manager.h>

#include "EnemyMgr.h"
#include "GameState.h"
#include "Player.h"
#include "Turret.h"
#include "TurretMgr.h"

// Vita AR includes
#include <camera.h>
#include <gxm.h>
#include <motion.h>
#include <libdbg.h>
#include <libsmart.h>
#include "Gun.h"
#include <sony_sample_framework.h>
#include <sony_tracking.h>
class PlayState : public GameState
{
public:
	PlayState(const abfw::Platform& platform);
	
	~PlayState();
	
	bool GameLost();
	int GetPlayerScore();

	GameStates::State Update();
	void Draw2D(abfw::SpriteRenderer* render, abfw::Matrix44 Projection);
	void Draw3D(abfw::Renderer3D* render,abfw::Colour defaultColour);

	static GameState* Instance() {
		return &mPlayState;
	}


private:
	static PlayState mPlayState;
	abfw::Font* mFont;
	
	abfw::OBJLoader mObjLoader;

	EnemyMgr mEnemyManager;
	abfw::Model mEnemyMesh;

	//-- 3D models
	abfw::Model mBulletModel;
	abfw::Model mTurretModel;
	abfw::Model mBaseModel;

	//-- A game object that will be drawn on each visible marker
	GameObject mBase[6];

	bool mTurretCardVisible;

	Player mPlayer;
	Gun mPlayerGun;
	int shootTimer;

	abfw::SonyControllerInputManager* mInputManager;

	//-- Stores the default ambient light value
	abfw::Colour defaultColour;

	//-- turrets
	std::vector<Turret> mCurrentTurrets;
	TurretMgr mTurretMgr;
};

#endif